/* 主容器 */
.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background-color: #f5f5f5;
}

/* 头部导航 */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background-color: #fff;
    border-bottom: 1px solid #e8e8e8;
    position: sticky;
    top: 0;
    z-index: 100;
}

.headerLeft {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: #333;
    font-size: 18px;
}

.headerTitle {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.headerRight {
    width: 100%;
    height: 50px;
    display: flex;
    align-items: center;
    font-size: 18px;
    gap: 12px;
    color: #666;
    font-size: 16px;
    justify-content: space-between;
    background-color: #fff;
    border-bottom: 1px solid #e8e8e8;
}

/* 开单记录链接 */
.recordLink {
    padding: 8px 16px;
    background-color: #fff;
    text-align: right;
    border-bottom: 1px solid #e8e8e8;
}

.recordLink span {
    color: #1890ff;
    font-size: 14px;
    cursor: pointer;
}

/* 标签页 */
.tabs {
    display: flex;
    background-color: #fff;
    border-bottom: 1px solid #e8e8e8;
    margin-bottom: 0;
}

.tab {
    margin-left: 40px;
    padding: 12px 5px;
 
}

.tab:hover {
    color: #1890ff;
}

.activeTab {
    color: #1890ff;
    font-weight: 600;
    border-bottom-color: #1890ff;
}

/* 主内容区域 */
.content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* 左侧分类列表 */
.sidebar {
    width: 120px;
    background-color: #fff;
    border-right: 1px solid #e8e8e8;
    overflow-y: auto;
    font-size: 18px;
}

.categoryItem {
    padding: 10px 8px;
    text-align: center;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s;
}

.categoryItem:hover {
    background-color: #f5f5f5;
    color: #1890ff;
}

.selectedCategory {
    background-color: #e6f7ff;
    color: #1890ff;
    font-weight: 600;
}

/* 右侧商品列表 */
.productList {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background-color: #f5f5f5;
}

.productItem {
    display: flex;
    background-color: #fff;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s;
}

.productItem:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.productImage {
    width: 80px;
    height: 80px;
    margin-right: 12px;
    border-radius: 6px;
    overflow: hidden;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.productImage img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.productInfo {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.productName {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    line-height: 1.4;
}

.productDescription {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
    line-height: 1.3;
}

.productPrice {
    font-size: 16px;
    font-weight: 600;
    color: #ff4d4f;
    margin-bottom: 8px;
    display: flex;
}

.productTags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.tag {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.prescriptionTag {
    background-color: #e6f7ff;
    color: #1890ff;
    border: 1px solid #91d5ff;
}

.limitTag {
    background-color: #fff2e8;
    color: #ff4d4f;
    border: 1px solid #ffbb96;
}

/* 数量选择器 */
.quantitySelector {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 12px;
}

.quantityBtn {
    width: 32px;
    height: 32px;
    border: 1px solid #d9d9d9;
    background-color: #fff;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    transition: all 0.3s;
}

.quantityBtn:hover:not(:disabled) {
    border-color: #1890ff;
    color: #1890ff;
}

.quantityBtn:disabled {
    background-color: #f5f5f5;
    color: #ccc;
    cursor: not-allowed;
}

.quantityInput {
    width: 50px;
    height: 32px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
    color: #333;
    background-color: #fff;
}

.quantityInput:focus {
    outline: none;
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

/* 底部购物车 */
.footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background-color: #fff;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.cartInfo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cartIcon {
    width: 40px;
    height: 40px;
    background-color: #1890ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
}

.cartText {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cartText>div:first-child {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.totalPrice {
    font-size: 16px;
    font-weight: 600;
    color: #ff4d4f;
}

.submitBtn {
    padding: 12px 42px;
    background-color: #1890ff;
    color: #fff;
    border: none;
    border-radius: 35px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 80px;
}

.submitBtn:hover:not(:disabled) {
    background-color: #40a9ff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(24, 144, 255, 0.3);
}

.submitBtn:disabled {
    background-color: #d9d9d9;
    color: #999;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        width: 80px;
    }

    .categoryItem {
        padding: 12px 4px;
        font-size: 12px;
    }

    .productItem {
        padding: 12px;
    }

    .productImage {
        width: 60px;
        height: 60px;
    }

    .productName {
        font-size: 14px;
    }

    .productDescription {
        font-size: 12px;
    }

    .quantitySelector {
        margin-left: 8px;
    }

    .quantityBtn {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }

    .quantityInput {
        width: 40px;
        height: 28px;
        font-size: 12px;
    }
}

/* 滚动条样式 */
.sidebar::-webkit-scrollbar,
.productList::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track,
.productList::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.sidebar::-webkit-scrollbar-thumb,
.productList::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
}

.sidebar::-webkit-scrollbar-thumb:hover,
.productList::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 购物车弹框样式 */
.cartModalOverlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 1000;
    padding: 0;
}

.cartModal {
    background: white;
    border-radius: 16px 16px 0 0;
    width: 100%;
    max-height: 70vh;
    overflow: hidden;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.cartModalHeader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.cartModalTitle {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.clearAllBtn {
    font-size: 14px;
    color: #1890ff;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.clearAllBtn:hover {
    background-color: #f0f8ff;
}

.cartModalContent {
    max-height: 400px;
    overflow-y: auto;
    padding: 0;
}

.cartModalItem {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.cartModalItem:last-child {
    border-bottom: none;
}

.cartItemIcon {
    width: 32px;
    height: 32px;
    background: #e6f7ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

.itemTypeIcon {
    font-size: 14px;
    color: #1890ff;
    font-weight: 600;
}

.cartItemInfo {
    flex: 1;
    margin-right: 12px;
}

.cartItemName {
    font-size: 14px;
    color: #333;
    font-weight: 500;
    margin-bottom: 4px;
    line-height: 1.4;
}

.cartItemPrice {
    font-size: 12px;
    color: #ff4d4f;
    font-weight: 600;
    margin-bottom: 4px;
}

.cartItemTags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.cartItemTag {
    font-size: 10px;
    padding: 2px 6px;
    background: #e6f7ff;
    color: #1890ff;
    border-radius: 3px;
    border: 1px solid #91d5ff;
}

.cartItemActions {
    display: flex;
    align-items: center;
}

.quantitySelector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quantityBtn {
    width: 24px;
    height: 24px;
    border: 1px solid #d9d9d9;
    background: white;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    transition: all 0.3s;
}

.quantityBtn:hover:not(:disabled) {
    border-color: #1890ff;
    color: #1890ff;
}

.quantityBtn:disabled {
    background: #f5f5f5;
    color: #ccc;
    cursor: not-allowed;
}

.quantityInput {
    width: 40px;
    height: 24px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    text-align: center;
    font-size: 12px;
    outline: none;
}

.quantityInput:focus {
    border-color: #1890ff;
}

.checkboxContainer {
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkbox {
    width: 20px;
    height: 20px;
    background: #1890ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
}

.emptyCart {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.emptyCartText {
    font-size: 16px;
    margin-bottom: 8px;
    color: #666;
}

.emptyCartSubText {
    font-size: 14px;
    color: #999;
}

/* 购物车信息点击样式 */
.cartInfo {
    cursor: pointer;
    transition: background-color 0.3s;
}

.cartInfo:hover {
    background-color: #f8f9fa;
}

/* 购物车弹框底部汇总栏 */
.cartModalFooter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-top: 1px solid #f0f0f0;
    background: white;
}

.cartSummary {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cartSummaryIcon {
    width: 32px;
    height: 32px;
    background: #1890ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
}

.cartSummaryText {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cartSummaryCount {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.cartSummaryCount span {
    color: #1890ff;
    font-weight: 600;
}

.cartSummaryTotal {
    font-size: 12px;
    color: #ff4d4f;
    font-weight: 600;
}

.cartSubmitBtn {
    background: #1890ff;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
    min-width: 80px;
}

.cartSubmitBtn:hover {
    background: #40a9ff;
}

/* 移动端购物车弹框适配 */
@media (max-width: 768px) {
    .cartModal {
        max-height: 60vh;
        border-radius: 20px 20px 0 0;
    }
    
    .cartModalHeader {
        padding: 12px 16px;
    }
    
    .cartModalTitle {
        font-size: 15px;
    }
    
    .cartModalItem {
        padding: 14px 16px;
    }
    
    .cartItemName {
        font-size: 13px;
    }
    
    .cartItemPrice {
        font-size: 11px;
    }
    
    .cartModalFooter {
        padding: 12px 16px;
    }
    
    .cartSummaryIcon {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    
    .cartSummaryCount {
        font-size: 13px;
    }
    
    .cartSummaryTotal {
        font-size: 11px;
    }
    
    .cartSubmitBtn {
        padding: 10px 20px;
        font-size: 13px;
        min-width: 70px;
    }
}